/**
 * 个人注册用户
 *
 * @date 2020-08-03
 * @author 逗号米
 */

import * as http from '@/http'
import * as api from '@/api/cms/personal/user'

/**
 * 首页
 *
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const index = (params?: any): Promise<any> => http.get(api.index, params)

/**
 * 查询
 *
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const query = (params?: any): Promise<any> => http.get(api.query, params)

/**
 * 存储
 *
 * @params params
 * @return {Promise<any>}
 */
export const store = (params: any): Promise<any> => http.post(api.store, params)

/**
 * 显示
 *
 * @params {int} id 主键
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const show = (id: number, params?: any): Promise<any> => http.get(api.show(id), params)

/**
 * 更新
 *
 * @params {int} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const update = (id: number, params: any): Promise<any> => http.put(api.update(id), params)

/**
 * 删除
 *
 * @params {int} id 主键
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const destroy = (id: number, params?: any): Promise<any> => http.del(api.destroy(id), params)

/**
 * 编辑用户名
 *
 * @params {int} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const modifyUsername = (id: number, params: any): Promise<any> => http.put(api.modifyUsername(id), params)

/**
 * 修改密码
 *
 * @params {int} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const modifyPassword = (id: number, params: any): Promise<any> => http.put(api.modifyPassword(id), params)

/**
 * 绑定手机号码
 *
 * @params {int} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const bindMobile = (id: number, params: any): Promise<any> => http.put(api.bindMobile(id), params)

/**
 * 绑定邮箱
 *
 * @params {int} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const bindEmail = (id: number, params: any): Promise<any> => http.put(api.bindEmail(id), params)

/**
 * 解除绑定
 *
 * @params {int} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const unBind = (id: number, params: any): Promise<any> => http.put(api.unBind(id), params)

/**
 * 退出客户端
 *
 * @params {int} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const logoutClient = (id: number, params: any): Promise<any> => http.put(api.logoutClient(id), params)

/**
 * 锁定
 *
 * @params {int} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const lock = (id: number, params: any): Promise<any> => http.put(api.lock(id), params)
